package com.originskyseed.platform.user.service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.originskyseed.platform.core.base.BasePage;
import com.originskyseed.platform.user.model.PkObjUserInfoVO;
import com.originskyseed.platform.user.model.SalesmanLevel;
import com.originskyseed.platform.user.model.UserInfo;

/**
 * 业务员等级体系Service接口类（OSI_SALESMAN_LEVEL）
 *
 * @author Tangwanghui
 */
public interface ISalesmanLevelService {

	/**
	 * 删除记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKey(String id) throws Exception;

	/**
	 * 批量删除记录
	 *
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKeys(List<String> ids) throws Exception;


	/**
	 * 批量修改删除的状态标识
	 *
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int updateByIds(List<String> ids) throws Exception;

	/**
	 * 插入记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insert(SalesmanLevel record) throws Exception;

	/**
	 * 插入记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insertSelective(SalesmanLevel record) throws Exception;

	/**
	 * 更新记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKey(SalesmanLevel record) throws Exception;

	/**
	 * 更新记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKeySelective(SalesmanLevel record) throws Exception;

	/**
	 * 查询记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public SalesmanLevel selectByPrimaryKey(String id) throws Exception;

	/**
	 * 查询列表
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public List<SalesmanLevel> selectList(SalesmanLevel record) throws Exception;


	/**
	 * 根据公司获取所属等级信息
	 * @param deptId
	 * @return
	 * @throws Exception
	 */
	public List<SalesmanLevel> selectListByDeptId(String deptId) throws Exception;

		/**
         * 分页查询列表
         *
         * @param params
         * @param page
         * @return
         * @throws Exception
         */
	public BasePage<SalesmanLevel> selectListByPage(Map<String, Object> params, BasePage<SalesmanLevel> page) throws Exception;

	/**
	 * 查询下一等级
	 *
	 * @param maxValue
	 * @return
	 * @throws Exception
	 */
	public SalesmanLevel selectNexLevel(BigDecimal maxValue) throws Exception;

	/**
	 * pk选择业务员pk对象分页列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public BasePage<PkObjUserInfoVO> selectPkSalesManObjListByPage(Map<String, Object> params, BasePage<PkObjUserInfoVO> page, String loginUser) throws Exception;

	/**
	 * pk选择业务员pk对象分页列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public BasePage<PkObjUserInfoVO> selectPkAnchorObjListByPage(Map<String, Object> params, BasePage<PkObjUserInfoVO> page, String loginUser) throws Exception;

	/**
	 * pk选择体系pk对象分页列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public BasePage<PkObjUserInfoVO> selectPkDeptObjListByPage(Map<String, Object> params, BasePage<PkObjUserInfoVO> page, UserInfo userInfo) throws Exception;

	/**
	 * 修改峰值
	 * 
	 * @param peakValue
	 * @return
	 * @throws Exception
	 */
	public int updatePeakValue(Integer peakValue) throws Exception;

	/**
	 * 查询经验值是否存在重复
	 * 
	 * @return
	 * @throws Exception
	 */
	public boolean selectEmpiricValue(SalesmanLevel record) throws Exception;

	/**
	 * 根据能量值查询等级id
	 * 
	 * @param empiricValue
	 * @return
	 * @throws Exception
	 */
	public String selectLevelIdByEmpiricValue(BigDecimal empiricValue,String belongDeptId) throws Exception;

	/**
	 * 定时更新用户的等级
	 * 
	 * @param tenantCode
	 * @throws Exception
	 */
	public void insertSalesLevel(String tenantCode) throws Exception;

}
